package edu.whu.rose.clock.kps.algorithm.blinks2.search3;

import edu.whu.rose.clock.kps.algorithm.blinks2.index.PNEntry2;

public class PNCursor31 extends Cursor31 {

	private PNEntry2[] list;
	
	private final short base;
	
	public PNCursor31(int block, int portal, short base, PNEntry2[] list) {
		super(block);
		this.base = base;
		this.list = list;
	}

	public boolean empty() {
		if (pos > list.length - 2) {
			return true;
		}
		else {
			return false;
		}
	}

	public int getFirst() {
		return list[pos].getFirst();
	}

	public int getNode() {
		return list[pos].getNode();
	}

	public short getDistance() {
		return (short)(base + list[pos].getDistance());
	}

	public short peek() {
		return (short)(base + list[pos + 1].getDistance());
	}

}
